First load in the data. Currently have to download the NyTimes county level data by hand and put it in the local directory.
Summary of the NYtimes county level data for Montana looks like:
## date county state
## Min. :2020-03-13 Gallatin : 23 Length:307
## 1st Qu.:2020-03-23 Lewis and Clark: 23 Class :character
## Median :2020-03-28 Silver Bow : 23 Mode :character
## Mean :2020-03-27 Yellowstone : 23
## 3rd Qu.:2020-04-01 Missoula : 22
## Max. :2020-04-04 Broadwater : 17
## (Other) :176
## fips cases deaths
## Length:307 Min. : 1.000 Min. :0.000
## Class :character 1st Qu.: 1.000 1st Qu.:0.000
## Mode :character Median : 3.000 Median :0.000
## Mean : 7.176 Mean :0.101
## 3rd Qu.: 6.000 3rd Qu.:0.000
## Max. :109.000 Max. :3.000
##
The current # of cases by county are:
Plot of the cases by county in Montana, but skip the zeros for now. If you scroll over the points it will provide details about the county and number of cases.
Plot it again but rescaled to a log axis and starting on the first day since 2 cases.
Now estimate the exponential growth rates by county and print the doubling times.
## # A tibble: 16 x 4
## # Groups: county [16]
## county t.double lo hi
## <chr> <dbl> <dbl> <dbl>
## 1 Broadwater 7.1 6.1 8.6
## 2 Cascade 6.5 5.6 7.7
## 3 Deer Lodge 6.2 3.1 NA
## 4 Flathead 4 3.6 4.4
## 5 Gallatin 3 2.7 3.3
## 6 Jefferson 10.9 7.2 23.5
## 7 Lake 5.2 3.7 9.6
## 8 Lewis and Clark 5.2 4.7 5.8
## 9 Lincoln 4.8 3.4 8
## 10 Madison 5.1 4.5 5.9
## 11 Missoula 6.3 6 6.7
## 12 Park 3.5 2.9 4.5
## 13 Ravalli 40.3 19.1 NA
## 14 Silver Bow 5.1 4.5 5.8
## 15 Toole 3.9 2.8 7.2
## 16 Yellowstone 4.3 3.9 4.8
Show the plot of these estimated growth curves.